package com.qf.dao.impl;

import com.qf.bean.Users;
import com.qf.dao.UsersDao;

import java.util.ArrayList;
import java.util.List;

/**
 * 2019/11/29
 * Administrator
 * restfulServer1129
 * 面向对象面向君  不负代码不负卿
 */
public class UsersDaoImpl implements UsersDao {
    public int insert(Users users) {
        System.out.println("insert Users，"+users);
        return 11;
    }

    public int update(Users users) {
        System.out.println("update Users，"+users);
        return 22;
    }

    public int delete(int userid) {
        System.out.println("delete Users，"+userid);
        return 33;
    }

    public Users findbyid(int userid) {
        System.out.println("findbyid Users");
        Users users = new Users(44, "王老五", "男");
        return users;
    }

    public List<Users> findall() {
        System.out.println("findall Users");
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < 5; i++) {
            Users users = new Users(10+i, "王老五", "男");
            arrayList.add(users);
        }
        return arrayList;
    }
}
